# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-fonts-encodings
pkgver=1.0.7
pkgrel=1
pkgdesc="X.org font encoding files"
arch=(any)
url="https://xorg.freedesktop.org/"
license=('custom')
makedepends=('xorg-mkfontscale' 'xorg-util-macros' 'xorg-font-util')
groups=('xorg-fonts' 'xorg')
options=(!makeflags)
source=(${url}/releases/individual/font/encodings-${pkgver}.tar.xz{,.sig})
sha512sums=('dc72982b14e5d89fe1eff1ab11f308796c89255a06337d8cd6bf65757f11dd0a5478b41d844793213db8fe9638389734f148abe9df9fb05027ea563dacde6ba8'
            'SKIP')
#validpgpkeys=('3BB639E56F861FA2E86505690FDD682D974CA72A') # "Matt Turner <mattst88@gmail.com>"
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

build() {
  cd encodings-${pkgver}
  ./configure --prefix=/usr
  make
}

package() {
  cd encodings-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # regenerate encodngs file not to include non-compressed versions
  cd "$pkgdir"/usr/share/fonts/encodings/large
  mkfontscale -b -s -l -n -r -p /usr/share/fonts/encodings/large -e . .
  cd "$pkgdir"/usr/share/fonts/encodings/
  mkfontscale -b -s -l -n -r -p /usr/share/fonts/encodings -e . -e large .
}
